﻿using Basic.HrModel.DB;
using Basic.HrRemoteModel.EmpFile.Model;
using WeDonekRpc.Client;
using WeDonekRpc.Helper.IdGenerator;
using WeDonekRpc.SqlSugar;

namespace Basic.HrDAL.Repository
{
    internal class EmpSelfFileDAL : BasicDAL<DBEmpSelfFileList, long>, IEmpSelfFileDAL
    {
        public EmpSelfFileDAL ( IRepository<DBEmpSelfFileList> basicDAL ) : base(basicDAL, "emp.self.file")
        {
        }

        public long Add ( EmpSelfFileAdd add )
        {
            DBEmpSelfFileList db = add.ConvertMap<EmpSelfFileAdd, DBEmpSelfFileList>();
            db.AddTime = DateTime.Now;
            db.Id = IdentityHelper.CreateId();
            this._BasicDAL.Insert(db);
            return db.Id;
        }
    }
}
